import apiClient from './client'
import type { ApiResponse } from '@/types/common'
import type { LoginRequest, UserInfo } from '@/types/user'

// 用户登录
export const login = async (data: LoginRequest): Promise<UserInfo> => {
  const response = await apiClient.post<ApiResponse<UserInfo>>('/user/login', data)
  return response.data.data
}
